package org.lzy.shop.adapter

import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import org.lzy.shop.R
import org.lzy.shop.response.AddressResponse

class ChooseAddressAdapter: BaseQuickAdapter<AddressResponse, QuickViewHolder>() {


    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): QuickViewHolder {
        return QuickViewHolder(R.layout.item_choose_address, parent)
    }

    override fun onBindViewHolder(
        holder: QuickViewHolder,
        position: Int,
        item: AddressResponse?
    ) {
        item?.let {
            holder.setText(R.id.show_province, item.province + item.city + item.district)
            holder.setText(R.id.show_address, item.address)
            holder.setText(R.id.address_person, item.phone)
        }
    }

}